
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module telemetry.web_perf.metrics.smoothness</title>
<meta charset="utf-8">
</head><body bgcolor="#f0f0f8">

<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="telemetry.html"><font color="#ffffff">telemetry</font></a>.<a href="telemetry.web_perf.html"><font color="#ffffff">web_perf</font></a>.<a href="telemetry.web_perf.metrics.html"><font color="#ffffff">metrics</font></a>.smoothness</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="../telemetry/web_perf/metrics/smoothness.py">telemetry/web_perf/metrics/smoothness.py</a></font></td></tr></table>
    <p><tt>#&nbsp;Copyright&nbsp;2014&nbsp;The&nbsp;Chromium&nbsp;Authors.&nbsp;All&nbsp;rights&nbsp;reserved.<br>
#&nbsp;Use&nbsp;of&nbsp;this&nbsp;source&nbsp;code&nbsp;is&nbsp;governed&nbsp;by&nbsp;a&nbsp;BSD-style&nbsp;license&nbsp;that&nbsp;can&nbsp;be<br>
#&nbsp;found&nbsp;in&nbsp;the&nbsp;LICENSE&nbsp;file.</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
    
<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="telemetry.value.improvement_direction.html">telemetry.value.improvement_direction</a><br>
<a href="telemetry.value.list_of_scalar_values.html">telemetry.value.list_of_scalar_values</a><br>
</td><td width="25%" valign=top><a href="logging.html">logging</a><br>
<a href="telemetry.util.perf_tests_helper.html">telemetry.util.perf_tests_helper</a><br>
</td><td width="25%" valign=top><a href="telemetry.web_perf.metrics.rendering_stats.html">telemetry.web_perf.metrics.rendering_stats</a><br>
<a href="telemetry.value.scalar.html">telemetry.value.scalar</a><br>
</td><td width="25%" valign=top><a href="telemetry.util.statistics.html">telemetry.util.statistics</a><br>
<a href="telemetry.web_perf.metrics.timeline_based_metric.html">telemetry.web_perf.metrics.timeline_based_metric</a><br>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
    
<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="telemetry.web_perf.metrics.timeline_based_metric.html#TimelineBasedMetric">telemetry.web_perf.metrics.timeline_based_metric.TimelineBasedMetric</a>(<a href="__builtin__.html#object">__builtin__.object</a>)
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="telemetry.web_perf.metrics.smoothness.html#SmoothnessMetric">SmoothnessMetric</a>
</font></dt></dl>
</dd>
</dl>
 <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="SmoothnessMetric">class <strong>SmoothnessMetric</strong></a>(<a href="telemetry.web_perf.metrics.timeline_based_metric.html#TimelineBasedMetric">telemetry.web_perf.metrics.timeline_based_metric.TimelineBasedMetric</a>)</font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>Computes&nbsp;metrics&nbsp;that&nbsp;measure&nbsp;smoothness&nbsp;of&nbsp;animations&nbsp;over&nbsp;given&nbsp;ranges.<br>
&nbsp;<br>
Animations&nbsp;are&nbsp;typically&nbsp;considered&nbsp;smooth&nbsp;if&nbsp;the&nbsp;frame&nbsp;rates&nbsp;are&nbsp;close&nbsp;to<br>
60&nbsp;frames&nbsp;per&nbsp;second&nbsp;(fps)&nbsp;and&nbsp;uniformly&nbsp;distributed&nbsp;over&nbsp;the&nbsp;sequence.&nbsp;To<br>
determine&nbsp;if&nbsp;a&nbsp;timeline&nbsp;range&nbsp;contains&nbsp;a&nbsp;smooth&nbsp;animation,&nbsp;we&nbsp;update&nbsp;the<br>
results&nbsp;object&nbsp;with&nbsp;several&nbsp;representative&nbsp;metrics:<br>
&nbsp;<br>
&nbsp;&nbsp;frame_times:&nbsp;A&nbsp;list&nbsp;of&nbsp;raw&nbsp;frame&nbsp;times<br>
&nbsp;&nbsp;mean_frame_time:&nbsp;The&nbsp;arithmetic&nbsp;mean&nbsp;of&nbsp;frame&nbsp;times<br>
&nbsp;&nbsp;percentage_smooth:&nbsp;Percentage&nbsp;of&nbsp;frames&nbsp;that&nbsp;were&nbsp;hitting&nbsp;60&nbsp;FPS.<br>
&nbsp;&nbsp;frame_time_discrepancy:&nbsp;The&nbsp;absolute&nbsp;discrepancy&nbsp;of&nbsp;frame&nbsp;timestamps<br>
&nbsp;&nbsp;mean_pixels_approximated:&nbsp;The&nbsp;mean&nbsp;percentage&nbsp;of&nbsp;pixels&nbsp;approximated<br>
&nbsp;&nbsp;queueing_durations:&nbsp;The&nbsp;queueing&nbsp;delay&nbsp;between&nbsp;compositor&nbsp;&amp;&nbsp;main&nbsp;threads<br>
&nbsp;<br>
Note&nbsp;that&nbsp;if&nbsp;any&nbsp;of&nbsp;the&nbsp;interaction&nbsp;records&nbsp;provided&nbsp;to&nbsp;AddResults&nbsp;have&nbsp;less<br>
than&nbsp;2&nbsp;frames,&nbsp;we&nbsp;will&nbsp;return&nbsp;telemetry&nbsp;values&nbsp;with&nbsp;None&nbsp;values&nbsp;for&nbsp;each&nbsp;of<br>
the&nbsp;smoothness&nbsp;metrics.&nbsp;Similarly,&nbsp;older&nbsp;browsers&nbsp;without&nbsp;support&nbsp;for<br>
tracking&nbsp;the&nbsp;BeginMainFrame&nbsp;events&nbsp;will&nbsp;report&nbsp;a&nbsp;ListOfScalarValues&nbsp;with&nbsp;a<br>
None&nbsp;value&nbsp;for&nbsp;the&nbsp;queueing&nbsp;duration&nbsp;metric.<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="telemetry.web_perf.metrics.smoothness.html#SmoothnessMetric">SmoothnessMetric</a></dd>
<dd><a href="telemetry.web_perf.metrics.timeline_based_metric.html#TimelineBasedMetric">telemetry.web_perf.metrics.timeline_based_metric.TimelineBasedMetric</a></dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="SmoothnessMetric-AddResults"><strong>AddResults</strong></a>(self, model, renderer_thread, interaction_records, results)</dt></dl>

<dl><dt><a name="SmoothnessMetric-__init__"><strong>__init__</strong></a>(self)</dt></dl>

<hr>
Methods inherited from <a href="telemetry.web_perf.metrics.timeline_based_metric.html#TimelineBasedMetric">telemetry.web_perf.metrics.timeline_based_metric.TimelineBasedMetric</a>:<br>
<dl><dt><a name="SmoothnessMetric-AddWholeTraceResults"><strong>AddWholeTraceResults</strong></a>(self, model, results)</dt><dd><tt>Computes&nbsp;and&nbsp;adds&nbsp;metrics&nbsp;corresponding&nbsp;to&nbsp;the&nbsp;entire&nbsp;trace.<br>
&nbsp;<br>
Override&nbsp;this&nbsp;method&nbsp;to&nbsp;compute&nbsp;results&nbsp;that&nbsp;correspond&nbsp;to&nbsp;the&nbsp;whole&nbsp;trace.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;model:&nbsp;An&nbsp;instance&nbsp;of&nbsp;telemetry.timeline.model.TimelineModel.<br>
&nbsp;&nbsp;results:&nbsp;An&nbsp;instance&nbsp;of&nbsp;page.PageTestResults.</tt></dd></dl>

<dl><dt><a name="SmoothnessMetric-VerifyNonOverlappedRecords"><strong>VerifyNonOverlappedRecords</strong></a>(self, interaction_records)</dt><dd><tt>This&nbsp;raises&nbsp;exceptions&nbsp;if&nbsp;interaction_records&nbsp;contain&nbsp;overlapped&nbsp;ranges.</tt></dd></dl>

<hr>
Data descriptors inherited from <a href="telemetry.web_perf.metrics.timeline_based_metric.html#TimelineBasedMetric">telemetry.web_perf.metrics.timeline_based_metric.TimelineBasedMetric</a>:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
    
<tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><strong>NOT_ENOUGH_FRAMES_MESSAGE</strong> = "Not enough frames for smoothness metrics (at lea...der extremely slow<font color="#c040c0">\n</font>- Pages that can't be scrolled"</td></tr></table>
</body></html>